Appendix D: Regular Expressions

Regular Expressions are patterns used to match character combinations in strings, for example a phone number or email address can be checked against a Regular Expression pattern to validate they conform to a certain format.

Regular Expressions use a definition language where characters have special meaning. There are many special characters, the ones used in the examples that follow are:

Patient Identifier Examples for SilhouetteConnect

Example A

A 5 digit patient number would be written as:

Example B

A 3 digit unit ID, a dash, then a 3 digit patient number would be written as:

Example C

Two upper-case alphabetic character unit ID, then 4 digit patient number would be written as:

Example D

 A three-digit unit ID, a dash, a patient number comprising 4, 5 or 6 numeric digits, and the last character being an upper-case A, B, or C to indicate three different study groups would be written as:

Through the simple use of regular expressions you can control the accuracy of information entered into a system and hence improve reliability and reduce errors.

Further reading and an interactive tutorial can be found here: http://regexone.com/

 

Using Regular Expressions the following types of structures can be specified:

Things to Note